package com.example.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;


@RestController
public class TestController {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Resource
    private AmqpTemplate amqpTemplate;

    @RequestMapping("send")
    public String send(){
        String uuid = UUID.randomUUID().toString();
        this.amqpTemplate.convertAndSend("xxxx",uuid);
        return uuid;
    }
}
